<template>
  <div id="stuMsg">
    <BackHeader :header="Header"></BackHeader>
    <div class="mt40" v-if="STU">
      <div class="stuImg mt10">
        <img :src='user.student.avatar' alt="">
      </div>
      <div>
        <mt-cell title="账号" :value="user.userName"></mt-cell>
        <mt-cell title="手机" :value="user.phone"></mt-cell>
        <mt-cell title="姓名" :value="user.student.name"></mt-cell>
        <mt-cell title="学号" :value="user.student.number"></mt-cell>
        <mt-cell title="年级" :value="user.student.grad"></mt-cell>
        <mt-cell title="邮箱" :value="user.student.email"></mt-cell>
        <mt-cell title="导师" :value="user.student.teacher"></mt-cell>
        <mt-cell title="辅导员" :value="user.student.assistant"></mt-cell>
      </div>
    </div>
    <div class="mt40" v-else>
      <mt-cell title="账号" :value="user.userName"></mt-cell>
      <mt-cell title="手机" :value="user.userName"></mt-cell>
      <div class="ptext">你还没有学生认证喔！~</div>
    </div>
  </div>
</template>
<script>
import { Cell } from 'mint-ui';
import BackHeader from "../../components/Header/BackHeader.vue";
import MemberCenterProvider from "@/providers/MemberCenterProvider";
export default {
  name:'stuMsg',
  data(){
    return{
      Header:'个人信息',
      user:[],
      STU: false
    }
  },
  components: {
    BackHeader
  },
  mounted(){
    this.init()
  },
  methods:{
    init(){
      let self = this;
       MemberCenterProvider.getUserMsg().then(res=>{
         self.user = res.data;
         self.STU = true;
       })
    }
  }
}
</script>
<style lang="scss" scoped>
.mt10{
  margin-top: 10px;
}
.stuImg{
  text-align: center
}
.ptext{
  margin: 30px;
}
</style>
